<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="#preset/reward/">加奖数据管理</a>
            </li>
        </ol>
    </div>
    <div class="topbar-right">
        <a href="#preset/reward/add/" class="btn btn-default btn-sm light fw600 ml10"><span class="fa fa-plus pr5"></span>新增加奖数据</a>
        <div class="ml15 ib va-m" id="toggle_sidemenu_r">
            <a href="#" class="pl5"> <i class="fa fa-sign-in fs22 text-primary"></i>
            </a>
        </div>
    </div>
</header>

<section id="content" class="animated fadeIn">
    <div class="panel overflow" >
        <table class="table table-striped fs13" id="main-list">
            <thead>
                <tr class="bg-light">
                    <th>ID</th>
                    <th>名称</th>
                    <th>开始期号</th>
                    <th>结束期号</th>
                    <th>加奖比例</th>
                    <th>加奖金额</th>
                    <th>加奖彩种</th>
                    <th>加奖玩法</th>
                    <th class="sortable" data-field="updated_at">最后修改时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody class="admin-form">
                <% var moment = require('moment'); %>
                <% _.each(rewards, function(reward){ %>
                    <tr data-id="<%= reward.id %>" >
                        <td><a href="#preset/reward/<%= reward.id %>/" ><%= reward.id %></a></td>
                        <td><%= reward.title %></td>
                        <td><%= JSON.parse(reward.condition).term[0][0] %></td>
                        <td><%= JSON.parse(reward.condition).term[0][1] %></td>
                        <td><%= reward.rate %> % </td>
                        <td><%= reward.amount %></td>
                        <td><%= window.LOTTERY_TYPE[reward.activity_type] %></td>
                        <td><%= reward.bet_type == 0 ? '全部' : window.BET_TYPE[reward.activity_type][reward.bet_type] %></td>
                        <td><%= reward.updated_at %></td>
                        <td class="text-left">
                            <a class="glyphicons glyphicons-pencil" href="#preset/reward/<%= reward.id %>/"></a>
                            <a class="glyphicons glyphicons-remove_2 onClickDelete" href="javascript:;"></a>
                        </td>
                    </tr>
                <%
                }) %>
            </tbody>
        </table>
    </div>

    <div><div class="pull-left" id="page-tips"></div><div id="paginator"></div></div>
</section>

<!-- Start: Right Sidebar -->
<aside id="sidebar_right" class="nano">
    <div class="p20 admin-form">

        <h4 class="mt5 text-muted fw500">过滤条件：</h4>

        <hr class="short">

        <div class="section mb15">
            <label for="searchTitle" class="field prepend-icon">
                <input title="名称" type="text" data-field="title" id="searchTitle" class="gui-input" placeholder="名称" value="<%= searched.title  %>">
                <label for="searchTitle" class="field-icon"><i class="fa fa-tag"></i>
                </label>
            </label>
        </div>

        <h6 class="fw400">当前状态</h6>
        <div class="section mb15">
            <label class="field select">
                <select id="searchStatus" name="searchStatus" data-field="status">
                    <option value="-1" <%= searched.status == -1 ? 'selected' : '' %>>所有</option>
                    <option value="1" <%= searched.status == 1 ? 'selected' : '' %>>已过期</option>
                    <option value="2" <%= searched.status == 2 ? 'selected' : '' %>>生效中</option>
                    <option value="3" <%= searched.status == 3 ? 'selected' : '' %>>待生效</option>
                </select>
                <i class="arrow double"></i>
            </label>
        </div>
        <hr class="short">

        <button class="btn btn-primary btn-block" type="button" id="search">搜索</button>

    </div>
</aside>
<!-- End: Right Sidebar -->
